#!/bin/bash -eu

dir=$(realpath $(dirname $0)/../)
tmp_file=$(mktemp)

pngpaste $tmp_file

hash=$(md5 < $tmp_file)
uri="src/images/$hash.png"

mv $tmp_file "$dir/$uri"
echo "![](https://github.com/wi1dcard/laravel-deployment/raw/master/$uri)" | tee >(pbcopy)
